package com.lzy.cloud.goods.service.carRent.Impl;

import com.lzy.cloud.goods.dtos.CarImageDto;
import com.lzy.cloud.goods.dtos.InsuranceDto;
import com.lzy.cloud.goods.entity.Insurance;
import com.lzy.cloud.goods.mapper.InsuranceMapperExt;
import com.lzy.cloud.goods.service.carRent.InsuranceService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lc
 * @version 2018/7/12
 */
@Service
public class InsuranceServiceImpl implements InsuranceService {

    @Autowired
    private InsuranceMapperExt insuranceMapperExt;

    @Override
    public Boolean add(InsuranceDto insuranceDto) {
        return insuranceMapperExt.insertSelective(DozerUtils.map(insuranceDto,Insurance.class))>0;
    }

    @Override
    public List<InsuranceDto> selectList(InsuranceDto insuranceDto) {
        return insuranceMapperExt.selectList(insuranceDto);
    }

    @Override
    public Boolean delByKeyTrue(InsuranceDto insuranceDto) {
        return insuranceMapperExt.delByKeyTrue(insuranceDto)>0;
    }
}
